-
Notifications
You must be signed in to change notification settings - Fork 577
test: add E2E tests for global rules #3248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add E2E tests for global rules #3248
Conversation
- Added global_rules POM with navigation and assertions - Added list test with pagination support (11 items) - Added CRUD test with required fields (single plugin) - Added CRUD test with all fields (multiple plugins) - Tests verify create and delete functionality - All 5 tests passing Closes apache#3088
Restored comments for clarity on configuration options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive E2E test coverage for the Global Rules resource, introducing 5 new tests across 3 test files and a new Page Object Model (POM) file. The implementation follows existing patterns from routes and upstreams tests.
Key Changes:
- Added Page Object Model for global rules navigation and assertions
- Added list page tests with pagination functionality (3 tests)
- Added CRUD tests for both minimal and complex plugin configurations (2 tests)
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| e2e/pom/global_rules.ts | Page Object Model with navigation helpers and assertions for global rules, following the routes POM pattern |
| e2e/tests/global_rules.list.spec.ts | List page tests including navigation, component visibility checks, and pagination tests with 11 test global rules |
| e2e/tests/global_rules.crud-required-fields.spec.ts | CRUD test using single plugin (response-rewrite) with minimal configuration; covers create and delete operations |
| e2e/tests/global_rules.crud-all-fields.spec.ts | CRUD test using multiple plugins (response-rewrite + cors) with complex configurations; covers create and delete operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .click(); | ||
|
|
||
| await globalRulePom.isIndexPage(page); | ||
|
|
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Please remove the whitespace at the end of this line.
| .click(); | ||
|
|
||
| await globalRulePom.isIndexPage(page); | ||
|
|
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Please remove the whitespace at the end of this line.
Why submit this pull request?
What changes will this PR take into?
This PR adds comprehensive E2E tests for the Global Rules resource, covering all CRUD operations and list page functionality.
Test Coverage (5 tests, all passing ✅):
List page tests (global_rules.list.spec.ts) - 3 tests
CRUD with required fields (global_rules.crud-required-fields.spec.ts) - 1 test
CRUD with all fields (global_rules.crud-all-fields.spec.ts) - 1 test
Files Added:
e2e/pom/global_rules.ts- Page Object Model with navigation helpers and assertionse2e/tests/global_rules.list.spec.ts- List page and pagination testse2e/tests/global_rules.crud-required-fields.spec.ts- Single plugin CRUD testse2e/tests/global_rules.crud-all-fields.spec.ts- Multiple plugins CRUD testsImplementation Details:
Related issues
Closes #3088
Checklist: